<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<ui:param name="pageName" value="Personal Info"></ui:param>
	<ui:define name="sidebar">
	<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
	
		<h:form>
		    <h:outputText value="Travel Expense Requests (for Recommendation)" styleClass="outputTextTitle"/>
		<p:growl />
			
			<p:tabView id="tabView" > 
				
				<p:tab id="tab1" title="Inprocess" >  
					
				  <p:dataTable value="#{inprocessTravelExpensesBean.travelExpenseInprocess}" var="travelExpense" >  
	  
		           <p:column headerText="S.No" style="width: 25px;"> 
		                <h:outputText value="#{travelExpense.sNo}" />
		            </p:column>  
		  				
		  			<p:column headerText="Expense Code" style="width: 136px;">
		                <h:outputText value="#{travelExpense.travelExpenseCode}" />  
		            </p:column>
		            
		            <p:column headerText="Details"> 
		                <h:outputText value="Raised by: #{travelExpense.employee.firstName} (#{travelExpense.employee.employeeCode})" />
		                <h:outputText id="detail" value="more..." styleClass="wamLink" />
		                <p:tooltip for="detail">
		                	<h:panelGrid columnClasses="gridCellMiddleLeftAligned" style="">
		            			<h:outputText value="Travel Expense Details"  style="font-weight: bold; text-decoration: underline; margin-left: 2px;" />	
		                		<h:panelGrid columns="3" columnClasses="grid90pxCellTopLeftAligned">
			                		<h:outputText value="Expense code" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.travelExpenseCode}" />
			                		<h:outputText value="Date raised" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.requestDate}" >
			                			<f:convertDateTime pattern="dd-MMM-yyyy HH:mm" />
			                		</h:outputText>
			                		<h:outputText value="Raise by" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
		                			<h:outputText value="#{travelExpense.employee.firstName} #{travelExpense.employee.lastName}" />
		                			
		                			<h:outputText value="Recommender"  style="font-weight: bold;"/>
		                			<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.recommenderBy.firstName} #{travelExpense.recommenderBy.lastName}" />
			                		
			                		<h:outputText value="Approver"  style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.approvedBy.firstName} #{travelExpense.approvedBy.lastName}" />
			                		
			                		<h:outputText value="Status"  style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.recommenderStatus}" />
		                		</h:panelGrid>
		                		
		                		
		                		<p:spacer />
		                		
		                		<h:outputText value="Travel Detail"  style="font-weight: bold; text-decoration: underline; margin-left: 2px;" />
		                		
		                		<h:panelGrid columns="3" columnClasses="grid90pxCellTopLeftAligned">
			                		<h:outputText value="Travel code" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.travelRequest.travelRequestCode}" />
			                		<h:outputText value="Client" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:outputText value="#{travelExpense.travelRequest.client}" />
			                		<h:outputText value="Location" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
		                			<h:outputText value="#{travelExpense.travelRequest.clientLocation}" />
		                			<h:outputText value="Period" style="font-weight: bold;"/>
			                		<h:outputText value=":" />
			                		<h:panelGroup>
		                			<h:outputText value="#{travelExpense.travelRequest.periodFrom}" >
		                				<f:convertDateTime pattern="DD-MMM-yyyy" />
		                			</h:outputText>
		                			<h:outputText value=" to " />
		                			<h:outputText value="#{travelExpense.travelRequest.periodTo}" >
		                				<f:convertDateTime pattern="DD-MMM-yyyy" />
		                			</h:outputText>
		                			</h:panelGroup>
		                		</h:panelGrid>
		                		
		                	</h:panelGrid>
		                </p:tooltip>
		            </p:column>
		            
		            <p:column headerText="Status" style="width: 60px">
		                <h:outputText value="#{travelExpense.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column style="width: 100px;">
		                <p:commandButton action="#{inprocessTravelExpensesBean.travelExpenseRecommendAction}" value="Recommend" >			
							<f:param id="travelCode" name="travelCode" value="#{travelExpense.travelRequest.travelRequestCode}" />
							<f:param id="expenseCode" name="expenseCode" value="#{travelExpense.travelExpenseCode}" />
							<f:param id="employeeCode" name="employeeCode" value="#{travelExpense.employee.employeeCode}" />
							<f:param id="activity" name="activity" value="byRecommender" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab2" title="Recommended" >  
					
				  <p:dataTable value="#{inprocessTravelExpensesBean.travelExpenseRecommended}" var="travelExpense" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{travelExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{travelExpense.employee.firstName} #{travelExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Travel Code">
		                <h:outputText value="#{travelExpense.travelRequest.travelRequestCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{travelExpense.travelExpenseCode}" />  
		            </p:column> 
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{travelExpense.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{inprocessTravelExpensesBean.travelExpenseRecommendAction}" value="View" >			
							<f:param id="travelCode" name="travelCode" value="#{travelExpense.travelRequest.travelRequestCode}" />
							<f:param id="expenseCode" name="expenseCode" value="#{travelExpense.travelExpenseCode}" />
							<f:param id="employeeCode" name="employeeCode" value="#{travelExpense.employee.employeeCode}" />
							<f:param id="activity" name="activity" value="byRecommender" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
				
				<p:tab id="tab3" title="Rejected" >  
					
				  <p:dataTable value="#{inprocessTravelExpensesBean.travelExpenseRejected}" var="travelExpense" >  
	  
		           <p:column headerText="S.No"> 
		                <h:outputText value="#{travelExpense.sNo}" />
		            </p:column>  
		  
		            <p:column headerText="Raised By"> 
		                <h:outputText value="#{travelExpense.employee.firstName} #{travelExpense.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Travel Code">
		                <h:outputText value="#{travelExpense.travelRequest.travelRequestCode}" />  
		            </p:column>  
		            
		            <p:column headerText="Expense Code">
		                <h:outputText value="#{travelExpense.travelExpenseCode}" />  
		            </p:column> 
		            
		            <p:column headerText="Recommender Status">
		                <h:outputText value="#{travelExpense.recommenderStatus}" />
		            </p:column> 
		            
		            <p:column headerText="Approve">
		                <p:commandButton action="#{inprocessTravelExpensesBean.travelExpenseRecommendAction}" value="View" >			
							<f:param id="travelCode" name="travelCode" value="#{travelExpense.travelRequest.travelRequestCode}" />
							<f:param id="expenseCode" name="expenseCode" value="#{travelExpense.travelExpenseCode}" />
							<f:param id="employeeCode" name="employeeCode" value="#{travelExpense.employee.employeeCode}" />
							<f:param id="activity" name="activity" value="byRecommender" />
						</p:commandButton> 
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
				
				</p:tab> 
			
			</p:tabView>
			
		</h:form>
	</ui:define>
</ui:composition>

